<!--
 * @Descripttion:图片加载失败显示
 * @version:
 * @Author: lehaixia
 * @Date: 2022-11-06 10:56:25
 * @LastEditors: lehaixia
 * @LastEditTime: 2022-11-06 11:10:15
-->

<template>
  <div class="error-pic">
    <img v-if="!errorPhoto" src="@/assets/error.png">
    <img v-else :src="errorPhoto" alt="">
  </div>
</template>
<script>
export default {
  name: 'ErrorPic',
  props: {
    errorPhoto: {
      type: String,
      default: ''
    }
  }
}

</script>
<style lang="less" scoped>
  .error-pic {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    background-color: #eee;
    color: white;

    img {
      height: 100%;
      width: 100%;
      object-fit: contain;
    }
  }

</style>
